# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=rawsec-cli
_pkgname=rawsec_cli
pkgver=1.2.0.r7.gf7a08c6
_pyver=3.13
pkgrel=9
pkgdesc='Rawsec Inventory search CLI to find security tools and resources.'
arch=('any')
groups=('blackarch' 'blackarch-misc')
url='https://github.com/mBouamama/rawsec_cli'
license=('MIT')
depends=('python' 'python-requests' 'python-tabulate' 'python-click'
         'python-columnar' 'python-gitpython')
makedepends=('python-setuptools' 'git')
source=("git+https://github.com/mBouamama/$_pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $_pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $_pkgname

  python setup.py build
}

package() {
  cd $_pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  rm -rf "$pkgdir/usr/lib/python$_pyver/site-packages/tests/"
}

